package com.card.hwatt.controllers;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 单位考勤
 * 
 * @author Administrator
 * 
 */
@Controller
@Scope("prototype")
@RequestMapping("/public")
public class PublicController extends BaseController{

	/**
	 * 单位月考勤汇总
	 * 
	 * @return
	 */
	@RequestMapping("/monthsum")
	public String monthSum(HttpServletRequest request, ModelMap modelMap) {
		HttpSession session = request.getSession();
		modelMap.put("user", session.getAttribute("user"));
		modelMap.put("name", session.getAttribute("departmentName"));
		modelMap.put("code", session.getAttribute("departmentId"));
		return "publicmonthsum";
	}

	/**
	 * 单位月考勤汇总
	 * 
	 * @return
	 */
	@RequestMapping("/worksum")
	public String workSum(HttpServletRequest request, ModelMap modelMap) {
		HttpSession session = request.getSession();
		modelMap.put("user", session.getAttribute("user"));
		modelMap.put("name", session.getAttribute("departmentName"));
		modelMap.put("code", session.getAttribute("departmentId"));
		return "publicworksum";
	}

	/**
	 * 单位刷脸记录
	 * 
	 * @return
	 */
	@RequestMapping("/card")
	public String card(HttpServletRequest request, ModelMap modelMap) {
		HttpSession session = request.getSession();
		modelMap.put("user", session.getAttribute("user"));
		modelMap.put("name", session.getAttribute("departmentName"));
		modelMap.put("code", session.getAttribute("departmentId"));
		return "publiccard";
	}

	/**
	 * 单位刷脸记录统计
	 * 
	 * @return
	 */
	@RequestMapping("/cardrecord")
	public String cardrecord(HttpServletRequest request, ModelMap modelMap) {
		HttpSession session = request.getSession();
		modelMap.put("user", session.getAttribute("user"));
		modelMap.put("name", session.getAttribute("departmentName"));
		modelMap.put("code", session.getAttribute("departmentId"));
		return "publiccardrecord";
	}

	/**
	 * 单位请假查询
	 * 
	 * @return
	 */
	@RequestMapping("/leave")
	public String leave(HttpServletRequest request, ModelMap modelMap) {
		HttpSession session = request.getSession();
		modelMap.put("user", session.getAttribute("user"));
		modelMap.put("name", session.getAttribute("departmentName"));
		modelMap.put("code", session.getAttribute("departmentId"));
		return "publicleave";
	}

	/**
	 * 单位特殊考勤查询
	 * 
	 * @return
	 */
	@RequestMapping("/special")
	public String special(HttpServletRequest request, ModelMap modelMap) {
		HttpSession session = request.getSession();
		modelMap.put("user", session.getAttribute("user"));
		modelMap.put("name", session.getAttribute("departmentName"));
		modelMap.put("code", session.getAttribute("departmentId"));
		return "publicspecial";
	}
}
